/**
 * 神州信息(2012)
 */
package net.abbp.report.designer.form.action;

import java.awt.event.ActionEvent;

import net.abbp.report.context.ReportContext;
import net.abbp.report.designer.IDesigner;
import net.abbp.report.designer.context.DesignerContext;
import net.abbp.report.model.ReportModel;
import net.abbp.report.model.io.impl.ModelXmlIO;
import net.abbp.report.view.GridView;
import net.abbp.swing.util.ImageUtils;

import com.reportgear.designer.action.ReportAction;

/**
 * 保存表单操作
 * 
 * @version 1.0
 * @author <a herf="lexloo@gmail.com">lexloo</a>
 * @since ABBP 1.0
 * 
 *        <pre>
 * 历史：
 *      建立: Aug 2, 2012 lexloo
 * </pre>
 */
public class SaveAction extends ReportAction {

    public SaveAction() {
        setName("保存");
        setSmallIcon(ImageUtils.readIcon("file/save.png"));
    }

    public void actionPerformed(ActionEvent e) {
        GridView view = ReportContext.INSTANCE.getCurrentView();
        ReportModel model = view.getReportModel();

        System.out.println((new ModelXmlIO()).write(model));
    }
}
